/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/7 13:35
 * @Copyright 博为峰
 */
public class ForDemo01 {
    public static void main(String[] args) {
        /*
          for(初始化表达式;循环条件表达式;循环变量的变化){
            循环语句;
          }
         */

        //打印1-100之间的偶数
//        for (int i = 1; i <= 100; i++) {
//            if (i % 2 == 0) {
//                System.out.println("i = " + i);
//            }
//        }

        //打印1-100之间的偶数的个数
        int count = 0;
        for (int i = 1; i < 101; i++) {
            if (i % 2 == 0) {
                count++;
//                System.out.println("i = " + i);
            }
        }

//        System.out.println("count = " + count);

        //1-10累加的和 1+2+3+4...+10

        /*
          0+1=1
          1+2=3
          3+3=6
          6+4=10
         */
        int sum = 0;
        for (int i = 1; i <= 10; i++) {
            sum = sum + i;
        }
        System.out.println(sum);
    }
}
